<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>View and Configure a Company</title>
	<f:metadata>
		  <f:viewParam name="code" value="#{viewCompanyBean.selectedCompanyCode}"/>
	</f:metadata>
	
</h:head>

<h:body>

	<h:form prependId="true" id="mainForm">
	
		<p:messages id="messages" showDetail="true" autoUpdate="true" />

		<p:commandButton id="backButton"  icon="ui-icon-arrowrefresh-1-w" ajax="false" includeViewParams="true" immediate="true" value="Back to Company List" style="margin-left:0px;" action="/pages/admin/companies/viewall.xhtml" />
		<p:commandButton id="savePendingChangesButton"  icon="ui-icon-save" ajax="true"  value="Save Pending Changes" style="margin-left:10px;" action="#{viewCompanyBean.savePendingChanges}" update="mainForm" />
		
		<p:panel id="mainPanel" header="Please configure your selected company for data input field" style="width:50%; min-width:300px; max-width:500px; margin-top:10px; margin-bottom:10px;" styleClass="noBorderGrid">
			
			<p:panelGrid columns="4" style="margin-top:10px;">

				<h:outputText  value="Company Code" style="font-weight:bold;"/>
				<h:outputText  value="#{viewCompanyBean.selectedCompany.companyCode}"  style="font-weight:normal;"/>

				<h:outputText value="Company Name" style="font-weight:bold;"/>
				<h:outputText id="companyName" value="#{viewCompanyBean.selectedCompany.companyName}" required="true" style="width:150px;font-weight:normal;"/>

				<h:outputText  value="Company City" style="font-weight:bold;"/>
				<h:outputText id="companyCity" value="#{viewCompanyBean.selectedCompany.companyCity}" required="true" style="width:150px;font-weight:normal;"/>

				<h:outputText  value="Company Country" style="font-weight:bold;"/>
				<h:outputText value="#{viewCompanyBean.selectedCompany.companyCountry}" style="font-weight:normal;"/>
			</p:panelGrid>

			<br />
			<br />

		</p:panel>
		
		
	<p:tabView id="tabs" orientation="top" style="margin-bottom:50px;overflow:auto;" effect="blind" effectDuration="normal"  dynamic="true" cache="false" activeIndex="#{viewCompanyBean.activeTabIndex}">
	
	
    <p:tab title="1. Field Groupings" id="groupingsTab">
            <h:outputText
                value="Field Groupings are a convenient way to combine related fields together so that they appear together in the input forms when data is being entered, as well as when data is displayed in output views. The Field Groupings defined
                       for this company are shown below" />
            <br/>           
            <p:commandButton id="newFieldGroupingButton"  icon="ui-icon-plus"  value="Create New Field Grouping" style="margin-left:0px;margin-top:10px;" oncomplete="PF('groupingDialogWidget').show();" action="#{viewCompanyBean.prepareForNewFieldGrouping}" />    
            
            <br/><br/>
            <p:orderList  id="groupingsList" value="#{viewCompanyBean.selectedCompany.companyMetaConfig.fieldGropuings}" var="group" controlsLocation="none"  
                        itemLabel="#{group}" itemValue="#{group}"  rendered="#{viewCompanyBean.selectedCompany.companyMetaConfig != null}"/>     

			 <br/><br/> 
			<h:outputText   value="Metadata configs for the selected company have not been defined yet" rendered="#{viewCompanyBean.selectedCompany.companyMetaConfig == null}" style="font-weight:bold;color:red;"/>
			
            
    </p:tab>

    <p:tab title="2. Meta Fields" id="fieldsTab">
         <h:outputText value="Shown below are the input fields configured for this company"/>
         <br/><br/>
         <p:commandButton id="newFieldButton"  icon="ui-icon-plus" value="Create New Field" update=":fieldForm" style="margin-left:0px;margin-top:10px;"  onclick="wizard.loadStep (wizard.cfg.steps [0], true)" oncomplete="PF('fieldDialogWidget').show();" action="#{viewCompanyBean.prepareForCreateNewField}" />
         <br/><br/>
        <p:dataTable 
			id="fieldTable" style="margin-top:10px; margin-bottom:20px;" widgetVar="fieldDataTableWidget"
			var="field" value="#{viewCompanyBean.selectedCompany.companyMetaConfig.fields}" 
			paginator="true" rows="20" 
		    currentPageReportTemplate="Showing {startRecord}-{endRecord} out of {totalRecords}"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {JumpToPageDropdown} "
			rowsPerPageTemplate="20,30,40" paginatorPosition="bottom"
		>
		
			<p:column width="20px;">
				<p:commandButton icon="ui-icon-pencil" update=":fieldForm" onclick="wizard.loadStep (wizard.cfg.steps [0], true)" oncomplete="PF('fieldDialogWidget').show();" action="#{viewCompanyBean.prepareForEditField(field)}" />
			</p:column>
			
			<p:column id="fieldNameColumn" filterBy="#{field.fieldName}" filterMatchMode="startsWith" sortBy="#{field.fieldName}" headerText="Field Name">
				<h:outputText value="#{field.fieldName}"/>
			</p:column>

			<p:column id="fieldDisplayNameColumn" headerText="Display Name">
	         	<p:cellEditor>
	         		<f:facet name="output"><h:outputText value="#{field.fieldDisplayName}"/></f:facet>
	         		<f:facet name="input"><p:inputText value="#{field.fieldDisplayName}" style="margin-left:5px;"/></f:facet>
	         	</p:cellEditor>
        	</p:column>

			<p:column id="fieldGroupingColumn" filterBy="#{field.fieldGrouping}" filterMatchMode="startsWith" sortBy="#{field.fieldGrouping}" headerText="Field Grouping">
				<p:cellEditor>
	        		<f:facet name="output"><h:outputText value="#{field.fieldGrouping}"/></f:facet> 
	        		<f:facet name="input">
	        			<p:selectOneMenu   value="#{field.fieldGrouping}" style="margin-left:5px; width:150px;">
							<f:selectItems value="#{viewCompanyBean.selectedCompany.companyMetaConfig.fieldGropuings}" var="g" itemLabel="#{g}" itemValue="#{g}"/>  
						</p:selectOneMenu>
	        		</f:facet>
	        	</p:cellEditor>
        	</p:column>

			<p:column id="fieldTypeColumn" headerText="Field Type">
				<p:cellEditor>
            		<f:facet name="output"><h:outputText value="#{field.fieldType}"/></f:facet> 
            		<f:facet name="input">
            			<p:selectOneMenu   value="#{field.fieldType}" style="margin-left:5px; width:150px;">
							<f:selectItems value="#{viewCompanyBean.tempField.listOfAllTypes}" var="g" itemLabel="#{g}" itemValue="#{g}"/>  
						</p:selectOneMenu>
            		</f:facet> 
            		
            	</p:cellEditor>
        	</p:column>

			<p:column id="fieldSourceColumn" headerText="Field Source">
				  	<p:cellEditor>
	         		<f:facet name="output"><h:outputText value="#{field.fieldSource}"/></f:facet>
	         		<f:facet name="input"><p:inputText value="#{field.fieldSource}" style="margin-left:5px;"/></f:facet>
	         	</p:cellEditor>
        	</p:column>
        	
			<p:column id="fieldRequired"  headerText="Required">
				<p:cellEditor>
            	 	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.required}" disabled="true"/></f:facet>
            	 	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.required}" style="margin-left:5px;"/></f:facet>
            	 </p:cellEditor>  
        	</p:column>

			<p:column id="fieldSummaryTable" headerText="Show in Summary Table" >
				<p:cellEditor>
            	 	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.showInSummaryTable}" disabled="true"/></f:facet>	
            	 	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.showInSummaryTable}" style="margin-left:5px;"/></f:facet>	
            	 </p:cellEditor>  
        	</p:column>

			<p:column id="fieldDetailsPane"  headerText="Show in Details Pane">
	          <p:cellEditor>
	          	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.showInDetailsPane}" disabled="true"/></f:facet>
	          	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.showInDetailsPane}" style="margin-left:5px;"/></f:facet>
	          </p:cellEditor>
        	</p:column>

			<p:column id="searchablePane"  headerText="Searchable">
	          <p:cellEditor>
	          	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.searchable}" disabled="true"/></f:facet>
	          	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.searchable}" style="margin-left:5px;"/></f:facet>
	          </p:cellEditor>
        	</p:column>

			<p:column id="filterablePane"  headerText="Filterable">
	          <p:cellEditor>
	          	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.filterable}" disabled="true"/></f:facet>
	          	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.filterable}" style="margin-left:5px;"/></f:facet>
	          </p:cellEditor>
        	</p:column>

			<p:column id="sortable"  headerText="Sortable">
	          <p:cellEditor>
	          	<f:facet name="output"><p:selectBooleanCheckbox value="#{field.sortable}" disabled="true"/></f:facet>
	          	<f:facet name="input"><p:selectBooleanCheckbox value="#{field.sortable}" style="margin-left:5px;"/></f:facet>
	          </p:cellEditor>
        	</p:column>

        	
         </p:dataTable>
         
    </p:tab>

    <p:tab title="3. Input Form Layout" id="inputFormTab">

        <h:outputText   value="You can reorder Field Grouping and Fields in the order you wish them to appear on the input pages" />
		<p:outputPanel id="outputPanel"/>
		<h:outputText   value="Metadata configs for the selected company have not been defined yet" rendered="#{viewCompanyBean.selectedCompany.companyMetaConfig == null}" style="font-weight:bold;color:red;"/>
    </p:tab>

    <p:tab title="4. Output Details Pane Layout" id="outputFormTab">

        <h:outputText   value="You can reorder Field Grouping and Fields in the order you wish them to appear on the output (DISPLAY) pages" />
		<p:outputPanel id="outputPanelForOutput"/>
		<h:outputText   value="Metadata configs for the selected company have not been defined yet" rendered="#{viewCompanyBean.selectedCompany.companyMetaConfig == null}" style="font-weight:bold;color:red;"/>

    </p:tab>

    <p:tab title="5. Output Summary Table Layout" id="outputTableTab">

        <h:outputText   value="You can reorder Field Grouping and Fields in the order you wish them to appear on the output (DISPLAY) pages" />
		<p:outputPanel id="outputPanelForOutputTable"/>
		<h:outputText   value="Metadata configs for the selected company have not been defined yet" rendered="#{viewCompanyBean.selectedCompany.companyMetaConfig == null}" style="font-weight:bold;color:red;"/>

    </p:tab>



</p:tabView>

</h:form>

<p:dialog id="groupingDialog" header="Enter New Field Grouping" widgetVar="groupingDialogWidget" resizable="false" modal="true" style="min-width:150px; min-height:100px;">
	<h:form id="groupingForm">
	
		<h:panelGroup id="myHeadingScript">
    		<script type="text/javascript">
    			/* <![CDATA[ */
        		if(#{viewCompanyBean.hideHeadingDialog}) {
        			groupingDialogWidget.hide();
        		}
    			/* ]]> */
    		</script>
		</h:panelGroup>
	
		<p:messages autoUpdate="true" showDetail="true"/>
		
		<p:panelGrid columns="2" cellpadding="5" styleClass="noBorderGrid">
			<h:outputLabel for="groupingName" value="Field Grouping Name" />
			<p:inputText value="#{viewCompanyBean.tempInputFieldGrouping}" 	id="groupingName"  label="groupingName" style="width:250px;"/>
		</p:panelGrid>
		<br/><br/>
		<p:commandButton id="cancelFieldGroupingButton" value="Cancel"	onclick="PF('groupingDialogWidget').hide();" style="margin-left:10px;"/>
		<p:commandButton id="submitFieldGroupingButton" value="Submit"	actionListener="#{viewCompanyBean.createFieldGrouping}"  style="margin-left:10px;" update="groupingForm,:fieldForm,:mainForm"/>
		<br/><br/>
	</h:form>	
</p:dialog>



<h:form id="fieldForm">

<p:dialog id="fieldDialog" header="Enter New Field" widgetVar="fieldDialogWidget" resizable="true" modal="true" style="min-width:600px; min-height:400px;" >

	
		<h:panelGroup id="myScript">
    		<script type="text/javascript">
    			/* <![CDATA[ */
        		if(#{viewCompanyBean.hideDialog}) {
        			fieldDialogWidget.hide();
        		}
    			/* ]]> */
    		</script>
		</h:panelGroup>
	
		<p:messages autoUpdate="true" showDetail="true" id="createFieldMessages"/>
		
		<p:wizard flowListener="#{viewCompanyBean.onFlowProcess}" widgetVar="wizard">
		
		 <p:tab id="basicInfo" title="1. Basic Info" >  
		 <p:panel header="Please provide data type information about this field" style="margin-top:20px;margin-bottom:20px;">
		<p:panelGrid columns="2" cellpadding="5" styleClass="noBorderGrid">
		
			<h:outputLabel for="fieldName" value="Field  Name*" />
			<p:inputText    id="fieldName" value="#{viewCompanyBean.tempField.fieldName}" 	  style="width:250px;" readonly="#{viewCompanyBean.existingFieldBeingEdited}"/>
	
			<h:outputLabel for="fieldDisplayName" value="Field Display Name*" />
			<p:inputText    id="fieldDisplayName" value="#{viewCompanyBean.tempField.fieldDisplayName}" 	   style="width:250px;"/>
	
			<h:outputLabel    for="fieldGrouping" value="Field Grouping*" />
			<p:selectOneMenu   id="fieldGrouping" value="#{viewCompanyBean.tempField.fieldGrouping}" 	  style="width:260px;">
				<f:selectItem itemLabel="Select One" itemValue="" />  
            	<f:selectItems value="#{viewCompanyBean.selectedCompany.companyMetaConfig.fieldGropuings}" var="g" itemLabel="#{g}" itemValue="#{g}"/>  
			</p:selectOneMenu>
			
			<h:outputLabel for="fieldType" value="Field Type*" />
			<p:selectOneMenu   id="fieldType" value="#{viewCompanyBean.tempField.fieldType}" 	  style="width:260px;">
				<f:selectItem itemLabel="Select One" itemValue="" />  
            	<f:selectItems value="#{viewCompanyBean.tempField.listOfAllTypes}" var="type" itemLabel="#{type}" itemValue="#{type}"/>  
			</p:selectOneMenu>

			<h:outputLabel for="fieldHelpText" value="Field Help Text" />
			<p:inputText    id="fieldHelpText" value="#{viewCompanyBean.tempField.fieldHelpText}" 	   style="width:250px;"/>
		
		</p:panelGrid>
		</p:panel>
		</p:tab>
		
		
		<p:tab id="sourceInfo" title="2. Source of Field Value">  
		
		<p:panel header="Please speicfy how this field is populated" style="margin-top:20px;margin-bottom:20px;" id="sourceInfoPanel">
			<p:panelGrid columns="2" cellpadding="5" styleClass="noBorderGrid">
			
			<h:outputLabel for="fieldSourceDropdown" value="Source of Field Data" />
			<p:selectOneMenu  id="fieldSourceDropdown" value="#{viewCompanyBean.tempField.fieldSource}"  >
				<p:ajax update="sourceInfoPanel" listener="#{viewCompanyBean.validateLovSelectionOnlyForString()}"/>				
				<f:selectItem itemLabel="Select One" itemValue=""/>
				<f:selectItems value="#{viewCompanyBean.tempField.listOfAllSources}" var="g" itemLabel="#{g}" itemValue="#{g}"/>  
			</p:selectOneMenu>
			
			<h:panelGroup rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided From List of Values')}" id="lovGroup">
				<h:outputLabel for="fieldListOfValues" value="Line Delimited Valid Values (?)" id="labelForLov"/>
				<p:tooltip for="labelForLov" value="Specivy value:displayValue on each line"/>
			</h:panelGroup>
			<p:inputTextarea  id="fieldListOfValues" value="#{viewCompanyBean.tempField.tempListOfValuesDelimited}" 	   rows="6" cols="39" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided From List of Values')}"/>

			<h:outputLabel for="fieldAutoOptionSelected" value="Auto Population Option" rendered="#{viewCompanyBean.tempField.fieldSource.equals('Auto Populated')}"/>
			<p:selectOneMenu  id="fieldAutoOptionSelected" value="#{viewCompanyBean.tempField.fieldAutoOptionSelected}"  rendered="#{viewCompanyBean.tempField.fieldSource.equals('Auto Populated')}">
				<p:ajax update="sourceInfoPanel" listener="#{viewCompanyBean.validateAutoOptionSelectionWithFieldType()}"/>				
				<f:selectItem itemLabel="Select One" itemValue=""/>
				<f:selectItems value="#{viewCompanyBean.tempField.listOfAllAutoOptions}" var="g" itemLabel="#{g}" itemValue="#{g}"/>  
			</p:selectOneMenu>

			<h:outputLabel for="fieldExtractionPath" value="Search String" rendered="#{viewCompanyBean.tempField.fieldSource.equals('Extract from Data')}" />
			<p:inputText  id="fieldExtractionPath" value="#{viewCompanyBean.tempField.fieldExtractedDataPath}" rendered="#{viewCompanyBean.tempField.fieldSource.equals('Extract from Data')}"  style="width:215px;" />

			<h:panelGroup rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided') and viewCompanyBean.tempField.fieldType.equals('String')}">
				<h:outputLabel id="inputMaskLabel" for="inputMask" value="Input Mask (?)"  />
				<p:tooltip for="inputMaskLabel" value="Example: Product Key = a*-999-a999 .. Where a=alpha,9=numeric,*=any"/>
			</h:panelGroup>
			<p:inputText  id="inputMask" value="#{viewCompanyBean.tempField.inputMask}" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided') and viewCompanyBean.tempField.fieldType.equals('String')}"  style="width:215px;" />

			<h:outputLabel for="fieldRequired" value="Make a required field on Entry Form" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided From List of Values') || viewCompanyBean.tempField.fieldSource.equals('User Provided')}" />
			<p:selectBooleanCheckbox  id="fieldRequired" value="#{viewCompanyBean.tempField.required}" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided From List of Values') || viewCompanyBean.tempField.fieldSource.equals('User Provided')}" 	  />
	
			</p:panelGrid>
			</p:panel>
		</p:tab>
		
		<p:tab id="displayInfo" title="3. Display Settings">
		<p:panel header="Please configure how this field is displayed" style="margin-top:20px;margin-bottom:20px;">
		<p:panelGrid columns="2" cellpadding="5" styleClass="noBorderGrid">

			<h:outputLabel for="fieldShowInSummary" value="Show in Summary Table" />
			<p:selectBooleanCheckbox  id="fieldShowInSummary" value="#{viewCompanyBean.tempField.showInSummaryTable}" 	  />

			<h:outputLabel for="fieldShowInDetails" value="Show in Details Pane" />
			<p:selectBooleanCheckbox  id="fieldShowInDetails" value="#{viewCompanyBean.tempField.showInDetailsPane}" 	  />

			<h:outputLabel for="fieldSearchable" value="Searchable" />
			<p:selectBooleanCheckbox  id="fieldSearchable" value="#{viewCompanyBean.tempField.searchable}" 	  />

			<h:outputLabel for="fieldFilterable" value="Filterable" />
			<p:selectBooleanCheckbox  id="fieldFilterable" value="#{viewCompanyBean.tempField.filterable}" 	  />

			<h:outputLabel for="fieldSortable" value="Sortable" />
			<p:selectBooleanCheckbox  id="fieldSortable" value="#{viewCompanyBean.tempField.sortable}" 	  />

		</p:panelGrid>
		</p:panel>
		</p:tab>
		
		<p:tab id="confirmation" title="4. Confirmation">

		<p:panel header="Review and confirm your selections" style="margin-top:20px;margin-bottom:20px;">
			
			<br/>
			<p:outputLabel value="Basic Info" style="font-weight:bold;color:#19588C"/>
			<p:separator/>
	
			<p:panelGrid  styleClass="noBorderGrid">

				<p:row>
					<p:column><p:outputLabel value="Field Name" style="font-weight:bold;color:#19588C"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldName}"/></p:column>

					<p:column><p:outputLabel value="Field Display Name" style="font-weight:bold;color:#19588C"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldDisplayName}"/></p:column>
				</p:row>

				<p:row>
					<p:column><p:outputLabel value="Field Grouping" style="font-weight:bold;color:#19588C"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldGrouping}"/></p:column>

					<p:column><p:outputLabel value="Field Type" style="font-weight:bold;color:#19588C"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldType}"/></p:column>
				</p:row>
				
				<p:row>
					<p:column><p:outputLabel value="Field Help Text" style="font-weight:bold;color:#19588C"/></p:column>
					<p:column colspan="3"><h:outputText value="#{viewCompanyBean.tempField.fieldHelpText}"/></p:column>
				</p:row>
			</p:panelGrid>

			<br/>
			<p:outputLabel value="Source of Field Data" style="font-weight:bold;color:#19588C"/>
			<p:separator/>
	
			<p:panelGrid  styleClass="noBorderGrid" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided')}"> 
				<p:row>
					<p:column><p:outputLabel value="Source of Field Data" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldSource}"/></p:column>
					<p:column><p:outputLabel value="Required on Form" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.required}"/></p:column>
				</p:row>	
			</p:panelGrid>

			<p:panelGrid  styleClass="noBorderGrid" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided From List of Values')}"> 
				<p:row>
					<p:column><p:outputLabel value="Source of Field Data" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldSource}"/></p:column>
					<p:column><p:outputLabel value="Required on Form" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.required}"/></p:column>
				</p:row>
				<p:row>
					<p:column><p:outputLabel value="List of Valid Values" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column colspan="3"><h:outputText value="#{viewCompanyBean.tempField.tempListOfValuesDelimited}"/>	</p:column>
				</p:row>	
			
			</p:panelGrid>

			<p:panelGrid  styleClass="noBorderGrid" rendered="#{viewCompanyBean.tempField.fieldSource.equals('Auto Populated')}"> 
				<p:row>
					<p:column><p:outputLabel value="Source of Field Data" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldSource}"/></p:column>
					<p:column><p:outputLabel value="Auto Population Option" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldAutoOptionSelected}"/></p:column>
				</p:row>	
			</p:panelGrid>

			<p:panelGrid  styleClass="noBorderGrid" rendered="#{viewCompanyBean.tempField.fieldSource.equals('Extract from Data')}"> 
				<p:row>
					<p:column><p:outputLabel value="Source of Field Data" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldSource}"/></p:column>
					<p:column><p:outputLabel value="Extraction Path" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.fieldExtractedDataPath}"/></p:column>
				</p:row>	
			</p:panelGrid>
			
			<br/>
			<p:outputLabel value="Display Settings" style="font-weight:bold;color:#19588C"/>
			<p:separator/>
	
			<p:panelGrid  styleClass="noBorderGrid" rendered="#{viewCompanyBean.tempField.fieldSource.equals('User Provided')}"> 
				
				<p:row>
					<p:column><p:outputLabel value="Show in summary table" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.showInSummaryTable}"/></p:column>
					<p:column><p:outputLabel value="Show in details pane" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.showInDetailsPane}"/></p:column>
				</p:row>
				<p:row>
					<p:column><p:outputLabel value="Searchable" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.searchable}"/></p:column>
					<p:column><p:outputLabel value="Filterable" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column><h:outputText value="#{viewCompanyBean.tempField.filterable}"/></p:column>
				</p:row>
				<p:row>
					<p:column><p:outputLabel value="Sortable" style="font-weight:bold;color:#19588C;margin-right:20px;"/></p:column>
					<p:column colspan="3"><h:outputText value="#{viewCompanyBean.tempField.sortable}"/></p:column>
				</p:row>
					
			</p:panelGrid>
			
			
			<br/><br/>

			<p:commandButton id="cancelFieldButton" value="Cancel"	type="button" onclick="PF('fieldDialogWidget').hide();"  />
			<p:commandButton id="submitFieldButton" value="Submit"	 action="#{viewCompanyBean.createField}"   update=":mainForm:tabs:fieldTable,:mainForm:savePendingChangesButton,fieldForm,:mainForm:tabs:outputPanel"/>
		
		</p:panel>
		</p:tab>
		
		</p:wizard>
		<br/><br/>
		<br/><br/>
	
</p:dialog>
</h:form>	



</h:body>
</html>